<template>
  <div>
    <!-- 销售信息 -->
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span>销售信息</span>
      </div>
      <div class="form-container">
        <el-form ref="firstForm" :model="firstForm" :rules="rules" label-width="150px" class="demo-ruleForm" size="small">
          <el-form-item label="总佣金金额:" prop="commission">
            <el-input v-model="firstForm.commission" placeholder="请输入"/>
          </el-form-item>
          <el-form-item label="预估佣金：" prop="commission">
            省长佣金<el-input v-model="firstForm.commission" disabled style="width: 30%"/>
          </el-form-item>
          <el-form-item label="佣金结算：" >
            <el-radio v-model="firstForm.settlement_commission" label="0">卡片审核通过</el-radio>
            <el-radio v-model="firstForm.settlement_commission" label="1">卡片激活后</el-radio>
          </el-form-item>
        </el-form>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  mixins: [],
  props: {
    form: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      parameterList: [],
      supplierList: [],
      labelList: [], // 公司标签数据，数据源
      selectList: [], // 选中数据的集合
      commodityLabels: [], // 传递过来的商品的标签
      // classify_id: [],
      firstForm: {
        settlement_commission: '0',
        result: false
      },
      rules: {
      }
    }
  },
  watch: {
    form(vlaue) {
      this.firstForm = this.form
      this.firstForm.settlement_commission = '' + this.firstForm.settlement_commission
    }
  },
  created() {
  },
  methods: {
    // 给父组件传递收取表单的值
    sendSecondMsg() {
      this.$refs['firstForm'].validate((valid) => {
        if (valid) {
          this.firstForm.result = true
        }
        this.$emit('msgEvent', this.firstForm)
      })
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .form-container {
    width: 90%;
  }
  .box-card {
    margin-bottom: 10px;
  }
  .el-card__body {
    padding: 20px 20px 0 20px!important;
  }
  .form-container-parameter {
    background: #f3f3f3;
    padding: 20px 20px 0 0;
  }
</style>
